<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">

  <title>麦吉登录</title>

  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css">

  <link rel='stylesheet' href='css/jquery-ui.css'>
  <link rel='stylesheet prefetch' href='css/bootstrap.min.css'>
  <link rel="stylesheet" href="css/style0.css" media="screen" type="text/css" />

    <script src="js/modernizr.js"></script>
	<script src="js/jquery-1.11.3.min.js"></script>

</head>

<body class="login-page">

  <!--<body >-->
<div class="login-form">

		<div class="login-content">

			<div class="form-login-error">
				<h3>Invalid login</h3>
				<p>Enter <strong>demo</strong>/<strong>demo</strong> as login and password.</p>
			</div>

			<form  role="form" id="form_login">

				<div class="form-group">

					<div class="input-group">
						<div class="input-group-addon">
							<i class="fa fa-user"></i>
						</div>

						<input type="text" class="form-control" name="username" id="username" placeholder="Username" autocomplete="off" />
					</div>

				</div>

				<div class="form-group">

					<div class="input-group">
						<div class="input-group-addon">
							<i class="fa fa-key"></i>
						</div>

						<input type="password" class="form-control" name="password" id="password" placeholder="Password" autocomplete="off" />
					</div>

				</div>

				<div class="form-group">
					<input id="login" value="Login In" type="button" onclick="loginResult()" class="btn btn-primary btn-block btn-login">
						<i class="fa fa-sign-in"></i>

					</input>
				</div>
				<div class="form-group">
					<input id="register" value="Register" type="button"  class="btn btn-primary btn-block btn-login">
						<i class="fa fa-sign-in"></i>

					</input>
				</div>

				<!-- Implemented in v1.1.4 -->				<div class="form-group">
					<em>- or -</em>
				</div>

				<!--<div class="form-group">-->

					<!--<button type="button" class="btn btn-default btn-lg btn-block facebook-button">-->
						<!--&#160;&#160;-->
						<!--<i class="fa fa-facebook"></i>-->
               <!--|  Login with Facebook-->
					<!--</button>-->

				<!--</div>-->

				<!-- 

				You can also use other social network buttons
				<div class="form-group">

					<button type="button" class="btn btn-default btn-lg btn-block btn-icon icon-left twitter-button">
						Login with Twitter
						<i class="entypo-twitter"></i>
					</button>

				</div>

				<div class="form-group">

					<button type="button" class="btn btn-default btn-lg btn-block btn-icon icon-left google-button">
						Login with Google+
						<i class="entypo-gplus"></i>
					</button>

				</div> -->				
			</form>

			<div style="text-align:center;clear:both;">
<!--<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>-->
<!--<script src="/follow.js" type="text/javascript"></script>-->
</div>

		</div>

	</div>
 </div>

  <!--<script src='js/jquery_and_jqueryui.js'></script>-->

</body>
<script type="text/javascript">
	function loginResult(){
		var account= $("#username").val();
		var password= $("#password").val();
		var flag=false;
		$.ajax({
			url: "http://192.168.1.11:8080/WeiXin/login",
			type: "GET",
			dataType: "json",
			async:true,
			data: {
				"account":account ,
				"password":password
			},
			success:function(data) {
//					alert(data.status);
				alert(data.message);
				if(data.status=="0"){
					localStorage.setItem("iframesrc","message_recorded");
					localStorage.setItem("account",account);
					localStorage.setItem("nickname",data.data.nickname);
					localStorage.setItem("icon",data.data.icon);
					localStorage.setItem("address",data.data.address);
					flag=true;
					window.location.href="index1.html";
				}else{
					flag=false;
				}

			},
		});
		return flag;
	}
	$("#register").click(function(){
		window.location.href="register.html";
	});
</script>
</html>